## Compiler and linker settings
DEFINES = -Wall -Werror -g 
LIBOGRE = OGRE
LIBS = $(LIBOGRE) CEGUI-OGRE CEGUI
CXX = g++
CXOGRE =  $(shell pkg-config --cflags $(LIBOGRE)) $(DEFINES)
CXXFLAGS = $(shell pkg-config --cflags $(LIBS)) $(DEFINES)
LD = g++
LDFLAGS = $(shell pkg-config --libs $(LIBS))

## Files to include in yourApp project
APP = file.o folder.o vo.o trackball.o ogreapplication.o visualisation.o myapplication.o main.o

## Compilation and linking occurs here
Visage: $(APP)
	$(LD) $(LDFLAGS) $(APP) -ltinyxml -o Visage

folder.o: folder.h folder.cpp
	$(LD) $(CXOGRE) -c folder.cpp

file.o : file.h file.cpp
	$(LD) $(CXOGRE) -c file.cpp

vo.o : vo.h vo.cpp
	$(LD) $(CXOGRE) -c vo.cpp

main.o : main.cpp myapplication.h visualisation.h
	$(LD) $(CXOGRE) -c main.cpp 

myapplication.o : myapplication.cpp myapplication.h ogreapplication.h 
	$(LD) $(CXOGRE) -c myapplication.cpp   

trackball.o : trackball.h trackball.cpp
	$(LD) $(CXOGRE) -c trackball.cpp

visualisation.o : visualisation.h visualisation.cpp ogreapplication.h myapplication.h folder.h 
	$(LD) $(CXOGRE) -c visualisation.cpp

ogreapplication.o : ogreapplication.h ogreapplication.cpp
	$(LD) $(CXOGRE) -c ogreapplication.cpp

## Clean up
clean:
	rm -f $(APP) Visage
